<?php

/**
 * 每天00：00定时更新品牌流量池白名单
 */

error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ^ E_DEPRECATED);
ini_set('display_errors', 1);
require_once '/data/wwwroot/g_vendor/autoload.php';

use Biz\cache\brand\FlowPoolWhite as cFlowPoolWhite;
use Biz\model\brandFlowPool\FlowPoolWhite as mFlowPoolWhite;

cFlowPoolWhite::delAll();
$time = time();
$brandIds = mFlowPoolWhite::selectByWhere(['start_time[<=]' => $time, 'end_time[>=]' => $time], 'brand_id');
$brandIds = array_unique(array_filter($brandIds));
if ($brandIds) {
    cFlowPoolWhite::addBrand($brandIds);
}
